//
//  RBSearchResultGroupCell.m
//  zhongzhenglu
//
//  Created by 马军凯 on 2023/5/4.
//

#import "RBSearchResultGroupCell.h"
#import "RBSearchResultResponse.h"

@interface RBSearchResultGroupCell ()
//图片
@property (weak, nonatomic) IBOutlet UIImageView *picImageView;
//标题
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
//x人拼
@property (weak, nonatomic) IBOutlet UILabel *groupNumLabel;
//售价
@property (weak, nonatomic) IBOutlet UILabel *salePriceLabel;
//原价
@property (weak, nonatomic) IBOutlet UILabel *originPriceLabel;

@end

@implementation RBSearchResultGroupCell

- (void)awakeFromNib {
    [super awakeFromNib];
}
//赋值
- (void)setCellModel:(RBCellModel *)cellModel {
    RBSearchResultModel *model = cellModel.cellData;
    //图片
    [self.picImageView setImageWithUrl:model.goods_picurl placeHolder:nil];
    //标题
    self.titleLabel.text = model.goods_title;
    //人数
    self.groupNumLabel.text = [NSString stringWithFormat:@"%@人团", model.group_people_max];
    [self.groupNumLabel setRounderWithRectCorner:UIRectCornerTopLeft | UIRectCornerBottomRight radius:9];
    //价格
    self.salePriceLabel.attributedText = [NSString changeSectionFontWithString:[NSString stringWithFormat:@"¥%@", model.group_price] font:[UIFont boldSystemFontOfSize:11] from:0 lenth:1];
    //原价
    self.originPriceLabel.attributedText = [NSString stringMidLine:[NSString stringWithFormat:@"¥%@", model.shop_price]];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
}

@end
